/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.utbm.tx52.stamp.ui.actionprovider;

import android.app.Activity;
import android.content.Context;
import android.net.Uri;
import android.util.Log;
import android.view.ActionProvider;
import android.view.SubMenu;
import android.view.View;
import android.widget.QuickContactBadge;

/**
 * Action provider used in the main activity when clicking on the button new
 * carte postale
 *
 * @author GREA Antoine
 * @author TISSERAND Geoffrey
 */
public class ContactBadge extends ActionProvider
{

	private Activity activity;
	public QuickContactBadge quickContactBadge;

	public ContactBadge(Context activity, Uri contact)
	{
		super(activity);
		this.activity = (Activity) activity;
		quickContactBadge = new QuickContactBadge(activity);
		quickContactBadge.assignContactUri(contact);
	}

	public ContactBadge(Context activity)
	{
		super(activity);
		this.activity = (Activity) activity;
		quickContactBadge = new QuickContactBadge(activity);
		quickContactBadge.setImageToDefault();
	}

	@Override
	public View onCreateActionView()
	{
		Log.d(this.getClass().getSimpleName(), "onCreateActionView");
		return quickContactBadge;
	}

	@Override
	public boolean onPerformDefaultAction()
	{
		Log.d(this.getClass().getSimpleName(), "onPerformDefaultAction");
		return super.onPerformDefaultAction();
	}

	@Override
	public boolean hasSubMenu()
	{
		Log.d(this.getClass().getSimpleName(), "hasSubMenu");
		return false;
	}

	@Override
	public void onPrepareSubMenu(SubMenu subMenu)
	{
		Log.d(this.getClass().getSimpleName(), "onPrepareSubMenu");
	}
}
